﻿<controls:OrganizationTypePanelBase x:Class="Rio.Framework.Pages.Controls.UCOrganizationTypePanel"
                                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                                    xmlns:local="clr-namespace:Rio.Framework.Pages.UserControls"
                                    xmlns:controls="clr-namespace:Rio.Framework.Pages.Controls.BaseClass"
                                    mc:Ignorable="d"
                                    DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <Grid x:Name="LayoutRoot" Margin="0,0,0,0">
        <Grid.Resources>
            <Style x:Key="ComboBoxStyle"
                   TargetType="ComboBox">
                <Setter Property="Height"
                        Value="25" />
                <Setter Property="HorizontalAlignment"
                        Value="Stretch" />
            </Style>
            <Style x:Key="TextBlockStyle"
                   TargetType="TextBlock">
                <Setter Property="Margin"
                        Value="5,5,5,0" />
                <Setter Property="HorizontalAlignment"
                        Value="Stretch" />
                <Setter Property="TextWrapping"
                        Value="Wrap" />
            </Style>
        </Grid.Resources>

        <StackPanel Grid.Row="0"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch">
            <TextBlock x:Name="labelOrganization"
                       Style="{StaticResource TextBlockStyle}" Text="Organization" />
            <StackPanel Orientation="Horizontal"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch">
                <Image x:Name="imageEntity"
                       Width="32"
                       Height="32"
                       Margin="5,0,0,0"
                       Source="../../Assets/Images/Entity.png" />
                <local:ObservableCombobox  x:Name="cbOrganization"
                                           Width="260"
                                           Style="{StaticResource ComboBoxStyle}"
                                           SelectionChanged="cbEntity_SelectionChanged"
                                           DisplayMemberPath="Name"
                                           SelectedValuePath="Identifier"
                                           ItemsSource="{Binding Organizations, Mode=TwoWay}"
                                           SelectedValue="{Binding SelectedOrganization.Identifier, Mode=TwoWay}"
                                           SelectedItem="{Binding SelectedOrganization, Mode=TwoWay}" Margin="5,0,5,0">
                </local:ObservableCombobox >
            </StackPanel>

            <TextBlock x:Name="labelFolderType"
                       Style="{StaticResource TextBlockStyle}" Text="Folder Type" />
            <StackPanel Orientation="Horizontal"
                        Margin="0,0,0,10"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch">
                <Image x:Name="imageFolderType"
                       Width="32"
                       Height="32"
                       Margin="5,0,0,0"
                       Source="../../Assets/Images/Folder.png" />
                <local:ObservableCombobox x:Name="cbFolderType"
                                          Width="260"
                                          Style="{StaticResource ComboBoxStyle}"
                                          SelectionChanged="cbFolderType_SelectionChanged"
                                          IsEnabled="false"
                                          DisplayMemberPath="Label"
                                          SelectedValuePath="Identifier"
                                          ItemsSource="{Binding FolderTypes, Mode=TwoWay}"
                                          SelectedValue="{Binding SelectedFolderType.Identifier, Mode=TwoWay}"
                                          SelectedItem="{Binding SelectedFolderType, Mode=TwoWay}" Margin="5,0,5,0">
                </local:ObservableCombobox>
            </StackPanel>
        </StackPanel>
    </Grid>
</controls:OrganizationTypePanelBase>
